#!/usr/local/bin/python
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import *

class ItemAdmin(admin.ModelAdmin):
    search_fields = ['label',]
    list_display = ('pk', 'date', 'label')
    list_filter = ('activite',)
admin.site.register(Item, ItemAdmin)

# edit_inline=True, num_in_admin=5, min_num_in_admin=1, num_extra_on_change=1
class SubItemAdmin(admin.ModelAdmin):
    pass
admin.site.register(SubItem, SubItemAdmin)

class EmpruntAdmin(admin.ModelAdmin):
    date_hierarchy = 'start'
    list_display=('item', 'start', 'end', 'membre')
    list_filter = ('membre',)
admin.site.register(Emprunt, EmpruntAdmin)

# edit_inline=True, num_extra_on_change=0
class ControleAdmin(admin.ModelAdmin):
    pass
admin.site.register(Controle, ControleAdmin)

class ActiviteAdmin(admin.ModelAdmin):
    list_display=('label', 'responsible')
admin.site.register(Activite, ActiviteAdmin)

class MembreAdmin(admin.ModelAdmin):
    search_fields = ('user',)
admin.site.register(Membre, MembreAdmin)

class CompteAdmin(admin.ModelAdmin):
    list_display=('pk', 'activite')
admin.site.register(Compte, CompteAdmin)

class OperationAdmin(admin.ModelAdmin):
    list_display=('date', 'dateCheck', 'membre', 'value')
    list_filter = ('compte', 'membre')
admin.site.register(Operation, OperationAdmin)
